package com.xuan.singleton.lazy;

public class Singleton3 {

    private static Singleton3 instance;
    private Singleton3() {}

    /**
     * 懒汉式单例 - 同步方法
     * @return
     */
    public synchronized static Singleton3 getInstance() {
        if (instance == null) {
            instance = new Singleton3();
        }
        return instance;
    }
}
